package string;

public class StringBuilderDemo {
    public static void main(String[] args) {
//        StringBuilder builder1=new StringBuilder();
//        StringBuilder builder2=new StringBuilder("abc");
//
//        String str="abc";
//        StringBuilder builder3=new StringBuilder(str);
//        String str1=builder3.toString();
        String str="好好学习Java";
    StringBuilder sb1=new StringBuilder(str);
    //append() demo
    sb1.append("，为了找个更好的工作");
        System.out.println(sb1);
    //replace() demo
        sb1.replace(8,sb1.length(),"，就是为了改变世界");
        System.out.println(sb1);
        //delete() demo
        sb1.delete(0,8);
        System.out.println(sb1);
        //insert() demo
        sb1.insert(0,"活着");
        System.out.println(sb1);
    }
}
